HTML Full Course [Day 4] [Hindi] π» | Table, Nested Table, Style π | Mohit Decodes
HTML Tutorial β Part 4: Tables, Styling & Nesting
Welcome to Part 4 of the HTML Full Course by Mohit Decodes! In this lesson, youβll learn how to present structured data using HTML tables, apply basic styling, and even nest tables inside tables.
π HTML Tables
HTML tables allow you to organize data in rows and columns using a structured format.
β Basic Table Tags:
<table>
β Starts the table<tr>
β Table row<th>
β Table header (bold and centered by default)<td>
β Table data cell
π Example:
π¨ HTML Table Styling
You can enhance the look of a table using inline styles or CSS.
π Example with Inline Style:
β Style Tips:
- Use
border-collapse: collapse;
to merge borders - Set
padding
for spacing - Use background colors for readability
π§© Nested HTML Tables
A nested table is a table placed inside a cell (<td>
) of another table. This is useful when you want to display complex data or group related data together.
π Example:
π Note: Avoid overusing nested tables for layout. Instead, use CSS Flexbox or Grid for modern layouts.